﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;

namespace TileEngine
{
    class Status
    {
        public Player player;
        public Status(Player player)
        {
            this.player = player;
        }
        public void draw(SpriteBatch spriteBatch)
        {
            int mX=Mouse.GetState().X;
            int mY=Mouse.GetState().Y;


            spriteBatch.Draw(Textures.bar, new Rectangle(70, 30, 100, 20), Color.White);
            spriteBatch.Draw(Textures.bar, new Rectangle(70, 60, 100, 20), Color.White);
            spriteBatch.Draw(Textures.bar, new Rectangle(70, 90, 100, 20), Color.White);
            spriteBatch.Draw(Textures.healthBar, new Rectangle(71, 31, (int)((98 * player.health) / player.getHealthMax()), 18), new Color(255, 255, 255, 150));
            spriteBatch.Draw(Textures.manaBar, new Rectangle(71, 61, (int)((98*player.mana)/player.getManaMax()), 18), new Color(255,255,255,150));
            spriteBatch.Draw(Textures.xpBar, new Rectangle(71, 91, (int)((98 * player.xp) /     player.nextXP), 18), new Color(255, 255, 255, 150));
            spriteBatch.DrawString(Textures.font10, ((int)player.health).ToString() + @"/" + player.getHealthMax(), new Vector2(73, 30), Color.Black);
            spriteBatch.DrawString(Textures.font10, ((int)player.mana).ToString() + @"/" + player.getManaMax(), new Vector2(73, 60), Color.Black);
            spriteBatch.DrawString(Textures.font10, ((int)player.xp).ToString() + @"/" + (int)player.nextXP, new Vector2(73, 90), Color.Black);

            spriteBatch.DrawString(Textures.font10, "Health:", new Vector2(10, 30), Color.White);
            spriteBatch.DrawString(Textures.font10, "Mana:", new Vector2(26, 60), Color.White);
            spriteBatch.DrawString(Textures.font10, "XP:", new Vector2(42, 90), Color.White);

            if (mX < 170 && mX > 70)
            {
                if (mY < 50 && mY > 30)
                {
                    spriteBatch.DrawString(Textures.font10Bold, "HP Regen:", new Vector2(mX + 10, mY + 10), Color.White);
                }
                if (mY < 80 && mY > 60)
                    spriteBatch.DrawString(Textures.font10Bold, "Mana Regen:", new Vector2(mX+10, mY+10), Color.White);
            }
        }
    }
}
